home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / March 96 / Re(2) Any tips for Building OD < prev    next >
Encoding:
Internet Message Format  |  1996-12-03  |  4.2 KB  |  [TEXT/ttxt]

  1. Subject:     Re(2): Any tips for Building ODF with CW8 CFM68k?
  2. Sent:        3/25/96 1:59 PM
  3. Received:    3/25/96 1:11 PM
  4. From:        Jim Lloyd, jim_lloyd@powertalk.apple.com
  5. Reply-To:    ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. Actually, I had similar binding problems while trying to get our parts working
  9. with CFM68K and never successfully debugged the problem until getting the last
  10. release of CFM68K tools from Metrowerks, at which time the problems went away.
  11.  At the suggestion of Stephen Coy <stevec@mpx.com.au>, I had also made one
  12. change that you may need to make.  Apparently, there is a problem with
  13. Metrowerk's ability to import MPW .o files, and because of it there are
  14. problems with ODMathM.o (inside the ODUtils subsystem).  This may or may not
  15. have been fixed in the most recent Metrowerks update, I haven't verified it
  16. yet.  To workaround the problem, you would need to take the source code in
  17. ODMathM.a and move it into the inline assembler format recognized by the
  18. Metrowerks C/C++ compiler.  I've pasted a sample at the end of this message.
  19.  
  20. We are getting very close to finalizing ODF 1, and expect all of the problems
  21. with CFM68K to be fixed (assuming I focus my time on fixing them).  For this
  22. reason, I am very reluctant to provide further technical support on CFM68K
  23. with ODF 1.0d11. If the information in this message doesn't allow you to get
  24. your parts working I'm afraid you'll have to wait till ODF 1 is released (in
  25. about 3 weeks).
  26.  
  27. Jim Lloyd
  28. ODF Team
  29.  
  30.  ------ From: ODF-Interest@CILabs.ORG, Mon, Mar 25, 1996 ------ 
  31.  
  32.  Thanks to Jim, now I can successfully link ODFNothing and ODFDraw with CW8
  33. CFM68k.
  34.  But, the resultant part won't produce stationary file when dropped on to
  35. OpenDoc App. Error message says "Unable to create the new Stationaly
  36. because the part editor could not be found. Please make sure it is
  37. installed correctly." I'm guessing that the fragment name set in "CFM68k"
  38. preferences panel of CWIDE is wrong.
  39.  
  40.  Can Jim or anybody suggest me the fragment name for ODFNothing? I've tried
  41. "ODFNothing" but no luck.
  42.  
  43.  
  44. ----- Following is some of ODMathM.a converted to MW inline assembler ----
  45.  
  46.  
  47. extern asm ODSLong ODWideDivide(const ODWide *dividend,
  48.                             ODSLong divisor, ODSLong *remainder)
  49. {
  50.             machine        68020
  51.             machine        68881
  52.             link            a6,#-2
  53.             moveq        #-1,d0
  54.             cmp.l        16(a6),d0            //    if (rem == (void *)-1)
  55.             seq            -1(a6)                //    set check
  56.             bne.s        @noCheck
  57.             clr.l            16(a6)            //        rem = 0
  58. @noCheck:
  59.             move.l        8(a6),a0            //    get num
  60.             move.l        (a0)+,d1
  61.             move.l        (a0),d0
  62.             move.l        12(a6),d2            //    get denom
  63.             beq.s        @div0
  64.             bpl.s            @1
  65.             neg.l            d2
  66. @1:            tst.l            16(a6)            //        check rem
  67.             bne.s        @3
  68.             lsr.l            #1,d2
  69.             tst.l            d1
  70.             bpl.s            @2
  71.             neg.l            d2
  72. @2:            add.l            d2,d0
  73.             bfexts        d2{0:1},d2
  74.             addx.l        d2,d1
  75. @3:            divs.l        12(a6),d1:d0
  76.             bvc.s        @ok
  77.             move.l        12(a6),d2
  78. @div0:        tst.b            -1(a6)            //        check check
  79.             bne.s        @div1
  80.             eor.l            d1,d2
  81.             bmi.s        @div1
  82.             move.l        #0x7FFFFFFF,d0
  83.             bra.s        @div2
  84. @div1:        move.l        #0x80000000,d0
  85. @div2:        move.l        #0x80000000,d1
  86. @ok:        move.l        16(a6),d2            //    get rem
  87.             beq.s        @done
  88.             move.l        d2,a0
  89.             move.l        d1,(a0)
  90. @done:        unlk        a6
  91.             rtd            #12
  92. }
  93.  
  94. extern asm ODULong ODWideSquareRoot( const ODWide *src )
  95. {
  96.             machine        68020
  97.             machine        68881
  98.             move.l        (sp)+,a0
  99.             move.l        #0x80000000,d1
  100.             
  101.             // fmove.l        d1,fp1
  102.             opword        0xF201, 0x4080
  103.             
  104.             move.l        (sp),a1                //        Get src
  105.             move.l        (a1)+,d0            //        Get hi long
  106.             add.l        d1,d0                //        Offset for sign
  107.  
  108.             // fmove.l        d0,fp0                //        Move to FP0
  109.             opword        0xF200, 0x4000
  110.             
  111.             // fsub.x        fp1,fp0                //        Compensate for offset
  112.             opword        0xF200, 0x0428
  113.             
  114.             // fscale.w    #32,fp0                //        Shift by 32
  115.             opword        0xF23C, 0x5026, 0x0020
  116.             
  117.             move.l        (a1),d0                //        Get lo long
  118.             add.l        d1,d0                //        Offset for sign
  119.             
  120.             // fadd.l        d0,fp0                //        Add to FP0
  121.             opword        0xF200, 0x4022
  122.             
  123.             // fsub.x        fp1,fp0                //        Compensate for offset
  124.             opword        0xF200, 0x0428
  125.             
  126.             // fsqrt.x        fp0                    //        The whole point
  127.             opword        0xF200, 0x0004
  128.             
  129.             // fadd.x        fp1,fp0                //        Offset for sign
  130.             opword        0xF200, 0x0422
  131.             
  132.             // fmove.l        fp0,d0                //        Pass result to D0
  133.             opword        0xF200, 0x6000
  134.             
  135.             sub.l        d1,d0                //        Compensate for offset
  136.             addq.l        #4,sp
  137.             jmp            (a0)
  138. }
  139.  
  140.  
  141.